<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Zend Gdata API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="../css/template.css" type="text/css"></link><script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="../js/jquery.tools.min.js"></script><script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="../js/template.js"></script></head><body><div id="content"><h1 class="file">Http/Client/Adapter/Curl.php</h1><div id="file-nav-box"><div id="file-nav-options">
              Show:
              <img src="../images/icons/visibility_public.png" alt="Public" id="show-public"></img><img src="../images/icons/visibility_protected.png" alt="Protected" id="show-protected"></img><img src="../images/icons/visibility_private.png" alt="Private" id="show-private"></img><span class="attribute" id="show-inherited">inherited</span></div><div id="file-nav-container"><ul id="file-nav"><li><a href="#classes"><img src="../images/icons/class.png" alt="Class" height="14"></img>
                          Classes
                      </a><ul><li><a href="#\Zend_Http_Client_Adapter_Curl">\Zend_Http_Client_Adapter_Curl</a></li></ul></li></ul><div style="clear: left;"></div></div><div id="file-nav-tab">
              Table of Contents
          </div></div><a name="top" class="anchor"></a><div id="file-description"><div class="short-description">Zend Framework</div><div class="long-description"><p>LICENSE</p>

<p>This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.</p></div></div><dl class="file-info"><dt>Category</dt><dd>Zend
         
    </dd><dt>Copyright</dt><dd>Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd><dt>License</dt><dd><a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd><dt>Package</dt><dd>Zend_Http
         
    </dd><dt>Subpackage</dt><dd>Client_Adapter
         
    </dd><dt>Version</dt><dd>$Id: Curl.php 24593 2012-01-05 20:35:02Z matthew $
         
    </dd></dl><a name="classes" class="anchor"></a><a id="\Zend_Http_Client_Adapter_Curl" class="anchor"></a><h2 class="class">\Zend_Http_Client_Adapter_Curl<div class="to-top"><a href="#top">jump to top</a></div></h2><div class="class"><small class="package"><b>Package: </b>Zend\Http\Client\Adapter</small><div class="short-description">An adapter class for Zend_Http_Client based on the curl extension.</div><div class="long-description"><p>Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl</p></div><dl class="class-info"><dt>Implements</dt><dd><a href="../files/Http.Client.Adapter.Interface.html#\Zend_Http_Client_Adapter_Interface">\Zend_Http_Client_Adapter_Interface</a></dd><dd><a href="../files/Http.Client.Adapter.Stream.html#\Zend_Http_Client_Adapter_Stream">\Zend_Http_Client_Adapter_Stream</a></dd><dt>Category</dt><dd>Zend
         
    </dd><dt>Copyright</dt><dd>Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd><dt>License</dt><dd><a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd></dl><h3>Properties</h3><div><a id="\Zend_Http_Client_Adapter_Curl::$_config" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>array <span class="highlight">$_config</span> = array()</code><div class="description"><div class="short-description">Parameters array</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array()</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::$_connected_to" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>array <span class="highlight">$_connected_to</span> = array(null, null)</code><div class="description"><div class="short-description">What host/port are we connected to?</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array(null, null)</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::$_curl" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>resource|null <span class="highlight">$_curl</span> = null</code><div class="description"><div class="short-description">The curl session handle</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>null</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>resource | null</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::$_invalidOverwritableCurlOptions" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>array <span class="highlight">$_invalidOverwritableCurlOptions</span></code><div class="description"><div class="short-description">List of cURL options that should never be overwritten</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::$_response" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>string <span class="highlight">$_response</span> = null</code><div class="description"><div class="short-description">Response gotten from server</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>null</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::$out_stream" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>resource <span class="highlight">$out_stream</span></code><div class="description"><div class="short-description">Stream for storing output</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>resource</dd></dl></div><div class="clear"></div></div></div><h3>Methods</h3><div><a id="\Zend_Http_Client_Adapter_Curl::__construct()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">__construct</span><span class="nb-faded-text">()</span> : void</code><div class="description"><p class="short_description">Adapter constructor</p></div><div class="code-tabs"><div class="long-description"><p>Config is set using setConfig()</p></div><strong>Throws</strong><table class="argument-info"><thead><tr><th>Exception</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Exception.html#\Zend_Http_Client_Adapter_Exception">\Zend_Http_Client_Adapter_Exception</a></td><td><em></em></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::close()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">close</span><span class="nb-faded-text">()</span> : void</code><div class="description"><p class="short_description">Close the connection to the server</p></div><div class="code-tabs"><div class="long-description"></div></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::connect()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">connect</span><span class="nb-faded-text">(string $host, int $port = 80, boolean $secure = false)</span> : void</code><div class="description"><p class="short_description">Initialize curl</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$host</th><td>string</td><td><em></em></td></tr><tr><th>$port</th><td>int</td><td><em></em></td></tr><tr><th>$secure</th><td>boolean</td><td><em></em></td></tr></table><strong>Throws</strong><table class="argument-info"><thead><tr><th>Exception</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Exception.html#\Zend_Http_Client_Adapter_Exception">\Zend_Http_Client_Adapter_Exception</a></td><td><em>if unable to connect</em></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::getConfig()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getConfig</span><span class="nb-faded-text">()</span> : array</code><div class="description"><p class="short_description">Retrieve the array of all configuration options</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>array</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::getHandle()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getHandle</span><span class="nb-faded-text">()</span> : resource</code><div class="description"><p class="short_description">Get cUrl Handle</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>resource</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::read()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">read</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Return read response from server</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::readHeader()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">readHeader</span><span class="nb-faded-text">(resource $curl, string $header)</span> : int</code><div class="description"><p class="short_description">Header reader function for CURL</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$curl</th><td>resource</td><td><em></em></td></tr><tr><th>$header</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>int</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::setConfig()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">setConfig</span><span class="nb-faded-text">(\Zend_Config $config = array())</span> : <a href="../files/Http.Client.Adapter.Curl.html#\Zend_Http_Client_Adapter_Curl">\Zend_Http_Client_Adapter_Curl</a></code><div class="description"><p class="short_description">Set the configuration array for the adapter</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$config</th><td>\Zend_Config</td><td><em><p>| array $config</p>
</em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Curl.html#\Zend_Http_Client_Adapter_Curl">\Zend_Http_Client_Adapter_Curl</a></td><td></td></tr></table><strong>Throws</strong><table class="argument-info"><thead><tr><th>Exception</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Exception.html#\Zend_Http_Client_Adapter_Exception">\Zend_Http_Client_Adapter_Exception</a></td><td><em></em></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::setCurlOption()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">setCurlOption</span><span class="nb-faded-text">(string | int $option, mixed $value)</span> : \Zend_Http_Adapter_Curl</code><div class="description"><p class="short_description">Direct setter for cURL adapter related options.</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$option</th><td>string | int</td><td><em></em></td></tr><tr><th>$value</th><td>mixed</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>\Zend_Http_Adapter_Curl</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::setOutputStream()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">setOutputStream</span><span class="nb-faded-text">(resource $stream)</span> : <a href="../files/Http.Client.Adapter.Socket.html#\Zend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></code><div class="description"><p class="short_description">Set output stream for the response</p></div><div class="code-tabs"><div class="long-description"><p>This function sets output stream where the result will be stored.</p></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$stream</th><td>resource</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Socket.html#\Zend_Http_Client_Adapter_Socket">\Zend_Http_Client_Adapter_Socket</a></td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Client_Adapter_Curl::write()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">write</span><span class="nb-faded-text">(string $method, <a href="../files/Uri.Http.html#\Zend_Uri_Http">\Zend_Uri_Http</a> $uri,  $httpVersion = 1.1, array $headers = array(), string $body = '')</span> : string</code><div class="description"><p class="short_description">Send request to the remote server</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$method</th><td>string</td><td><em></em></td></tr><tr><th>$uri</th><td><a href="../files/Uri.Http.html#\Zend_Uri_Http">\Zend_Uri_Http</a></td><td><em></em></td></tr><tr><th>$httpVersion</th><td></td><td><em></em></td></tr><tr><th>$headers</th><td>array</td><td><em></em></td></tr><tr><th>$body</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td>$request</td></tr></table><strong>Throws</strong><table class="argument-info"><thead><tr><th>Exception</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Client.Adapter.Exception.html#\Zend_Http_Client_Adapter_Exception">\Zend_Http_Client_Adapter_Exception</a></td><td><em>If connection fails, connected to wrong host, no PUT file defined, unsupported method, or unsupported cURL option</em></td></tr></table></div><div class="clear"></div></div></div></div></div><small class="footer">
            Documentation was generated by
            <a href="http://phpdoc.org">phpDocumentor
                2.0.0a12</a>.
        </small></body></html>
